#include <cstdio>
#include <cctype>
#include <stack>

using std::stack;


bool word_scramble ()
{
	int c;
	stack <int> s;

	while (c = getchar(), !isspace(c) && c != EOF)
	{
		s.push(c);
	}
	while (!s.empty())
	{
		putchar(s.top());
		s.pop();
	}
	if (c != EOF)
	{
		putchar(c);
		return true;
	}
	return false;
}


int main ()
{
	while (word_scramble());
	return 0;
}